<route lang="json5">
{ style: { navigationStyle: 'custom', navigationBarTitleText: '地图选点' } }
</route>

<template>
  <customHeader title="地图选点"></customHeader>

  <custom-container fixed>
    <map-Point
      @commitCheck="commitCheck"
      :mapKey="mapKey"
      :showResetting="showResetting"
      :listIco="listIco"
      :latitude="latitude"
      :longitude="longitude"
      :orientationIco="orientationIco"
      :resettingIco="resettingIco"
    ></map-Point>
  </custom-container>
</template>

<script>
export default {
  data() {
    return {
      mapKey: '737965f92c797efb5447a4d658328513',
      address: '',
      latitude: '',
      longitude: '',
      listIco:
        '',
      orientationIco:
        '',
      resettingIco:
        '',
      showResetting: true,
      delta: 1,
    }
  },
  onLoad(option) {
    if (option.delta) {
      this.delta = option.delta
    }
    if (option.latitude) {
      this.latitude = option.latitude
    }
    if (option.longitude) {
      this.longitude = option.longitude
    }
  },
  methods: {
    commitCheck(e) {
      if (!e) {
        uni.showToast({
          title: '请选择地址',
          icon: 'none',
        })
        return
      }
      uni.$emit('commitCheck', e)
      this.$store.commit('SET_MAP_PARAMES', e)
      console.log(e, '0909090')
      this.$store.commit('SET_ADRESS', e)
      uni.navigateBack({
        delta: this.delta,
      })
    },
  },
}
</script>

<style lang="scss" scoped></style>
